package com.HomeWorkhsp.chapter10.innerClass_;

/**
 * Enjoy programming!!!
 * Time: 2021/12/3 -  15:20
 */
public class InnerClassExercise02 {
    public static void main(String[] args) {
        CellPhone cellPhone = new CellPhone();


        cellPhone.alarmclock(new Bell(){
            public void ring(){
                System.out.println("懒猪起床了");
            }
        });

        cellPhone.alarmclock(new Bell(){
            public void ring(){
                System.out.println("小伙伴上课了");
            }
        });
    }
}
interface Bell{
    void ring();
}
class CellPhone{
    public void alarmclock(Bell bell){
        bell.ring();
        System.out.println(bell.getClass());
    }

}